
import os
from dotenv import load_dotenv

load_dotenv()

class Config:
    # 数据库配置
    DATABASE_URL = os.getenv("DATABASE_URL", "sqlite:///./toutiao_assistant.db")
    
    # 服务器配置
    HOST = os.getenv("HOST", "0.0.0.0")
    PORT = int(os.getenv("PORT", 8000))
    DEBUG = os.getenv("DEBUG", "false").lower() == "true"
    
    # 定时任务配置
    SCHEDULE_TIMES = os.getenv("SCHEDULE_TIMES", "09:00,14:00,20:00").split(",")
    
    # 文章生成配置
    DAILY_ARTICLE_COUNT = int(os.getenv("DAILY_ARTICLE_COUNT", 3))
    ARTICLE_TOPICS = [
        "科技前沿", "生活妙招", "健康养生", "职场技能", "教育育儿",
        "美食探店", "旅游攻略", "数码评测", "时尚潮流", "汽车资讯",
        "房产家居", "情感故事", "创业故事", "财经分析", "体育热点"
    ]
    
    # 内容过滤配置
    ENABLE_SENSITIVE_FILTER = os.getenv("ENABLE_SENSITIVE_FILTER", "true").lower() == "true"
    SENSITIVE_WORDS = ["暴力", "色情", "赌博", "毒品", "政治敏感"]
    
    # 图片配置
    DEFAULT_COVER_IMAGE = "https://via.placeholder.com/400x200?text=Article+Cover"
    
    # 日志配置
    LOG_LEVEL = os.getenv("LOG_LEVEL", "INFO")
    LOG_FILE = os.getenv("LOG_FILE", "./logs/app.log")
